package spring.yongongsystem.controller.merchant;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import spring.yongongsystem.POJO.dto.WorkerPageQueryDTO;
import spring.yongongsystem.result.PageResult;
import spring.yongongsystem.result.Result;
import spring.yongongsystem.service.WorkerService;

@RestController("merchantWorkerController")
@RequestMapping("/merchant/worker")
@Api(tags = "商家用工相关接口")
@Slf4j
public class WorkerController {

    @Autowired
    private WorkerService workerService;
    /**
     * 用工分页查询
     * @param workerPageQueryDTO
     * @return
     */
    @GetMapping("/page")
    @ApiOperation("用工分页查询")
    public Result<PageResult> page(WorkerPageQueryDTO workerPageQueryDTO){
        log.info("用工分页查询，参数为：{}", workerPageQueryDTO);
        PageResult pageResult = workerService.pageQuery(workerPageQueryDTO);
        return Result.success(pageResult);
    }

}
